# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=pg-gvm
pkgver=22.6.2
#PostgreSQL version
_pgver=16
pkgrel=0
pkgdesc="Greenbone Library for helper functions in PostgreSQL"
url="https://github.com/greenbone/pg-gvm"
arch="all"
license="GPL-3.0"
options="!check" # no check available
makedepends="cmake glib libical-dev gvm-libs-dev postgresql$_pgver-dev ninja"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/pg-gvm/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DPostgreSQL_INCLUDE_DIRS=/usr/include/postgresql/$_pgver/ \
		-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/$_pgver/
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3bba143d61a3159587a38832a9214a991f9fac5fecd2757d6b87fa9a7990c226ae2744fc296aab62a526910f591cf27f7b5c059ed32a0e0ceec1cf8d9ac1323a  pg-gvm-22.6.2.tar.gz
"
